import {
    legacy_createStore, // create_store / createStore
    combineReducers,
    applyMiddleware,
    CombinedState,
} from 'redux';
import head from './store/UserState/reducers/index';
// import homepage, { HomepageState } from './reducers/homepage';
// import user, { UserState } from './reducers/user';
import thunk from 'redux-thunk';

const reducers = {
    head,
};

// export type StoreState = CombinedState<{
//     head: HeadState;
//     user: UserState;
//     homepage: HomepageState;
// }>;

const rootReducer = combineReducers(reducers);

// 用合并好的reducer创建总store并导出
export default legacy_createStore(rootReducer, applyMiddleware(thunk));
